The melodic minor scale is obtained by raising the sixth and seventh degrees of a natural minor scale by a semitone, or if you prefer raising the sixth degree of an harmonic minor scale by a semitone.
According to the classical school, this scale is used in the ascending phase, while in the descending phase, the two degrees previously get up came back to their original state, provided by the natural minor scale.
Conversely, the Bachian scale is referred to when these two alterations on the VI and VII degree are played both in the ascending and descending phases.
The tones and semitones sequence for the melodic minor scale is as follows (T, S, T, T, T, T, S).
To obtain the melodic minor scale in any other key, it will be enough to apply the tone and semitone sequence just mentioned starting from the chosen tonic note.
The C melodic minor scale, for example, will be (C, D, Eb, F, G, A, B).